capture packet interface

Configures onboard packet capture on the interface.

Syntax

capture packet interface ethernet IFNAME { direction [ both | rx | tx ] [ packet-count number ] }
no capture packet interface ethernet IFNAME

Parameters

interface ethernet IFNAME
Specifies the interface name in slot/port or slot/port:breakout format. Example: 1/1, 1/1-3, 5, 2/7-9, 10:1-4.
direction
Specifies the type of packet capture.
both
Specifies both ingress and egress packet capture.
rx
Specifies ingress packet capture.
tx
Specifies egress packet capture.
packet-count number
Specifies the number of packets to be captured on the interface. Valid packet capture values range from 1 to 8000.

Modes

Exec mode

Usage Guidelines

This command is available only to users with the admin role.

Only one mirror session is allowed per port.

You must configure the interface before configuring packet capture.

A maximum of 10 mirror sessions per device are allowed.

Packet capture is not allowed if maximum PCAP files are already created.

When packet-count parameter is specified, the packet capture automatically stops on the interface after the specified number of packets are captured.

The maximum number of existing PCAP files cannot exceed 25.

Onboard packet capture is not persistent across reboot.

Examples

The following example configures both ingress and egress packet capture, up to 100, on ethernet interface 1/1.

device# capture packet interface ethernet 1/1 direction both packet-count 100
device# show capture packet config 

The following example removes packet capture configuration on the specified ethernet slot/port.

device# no capture packet interface ethernet 1/1